/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.myapp.forms;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author navneet
 */
public class AGAFB extends org.apache.struts.validator.ValidatorActionForm {

    private String groupName;
    private String description;
    private String error;

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }


    public AGAFB() {
        super();
    }
    @Override
    public void reset(ActionMapping mapping, HttpServletRequest request){
        groupName   = "";
        description = "";
        error       = "";
    }
    @Override
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getGroupName() == null || getGroupName().length() < 1) {
            errors.add("groupName", new ActionMessage("error.AGAFB.groupName.required"));
        }
        return errors;
    }
}
